<cfcomponent displayname="NamedGateway">

	<cffunction name="updateNamedListByUserID" access="remote" returntype="any" output="true">
		<cfif structKeyExists(form, "namedSequence")>
			#form.namedSequence#
			<cfloop from="1" index="counter" to="#listLen(form.namedSequence)#">
				<cfquery name="insertNamed" datasource="tidtool">
					INSERT INTO Named_Person
						(NamedID, PersonID)
					VALUES
						(#listGetAt(form.namedSequence, counter)#, #form.userID#)
				</cfquery>
			</cfloop>
		</cfif>
		<cfif structKeyExists(form, "namedDoubleSequence")>
			#form.namedDoubleSequence#
			<cfloop from="1" index="counter" to="#listLen(form.namedDoubleSequence)#">
				<cfquery name="insertNamedDouble" datasource="tidtool">
					INSERT INTO NamedDouble_Person
						(NamedID, PersonID)
					VALUES
						(#listGetAt(form.namedDoubleSequence, counter)#, #form.userID#)
				</cfquery>
			</cfloop>
		</cfif>
		&Auml;nderungen werden gespeichert...
		<form name="form" method="post" action="../index.cfm">
			<input type="hidden" name="contentPage" value="namedForm.cfm" />
			<input type="hidden" name="message" value="Named-Liste erfolgreich aktuallisiert." />
		</form>
		<script type="text/javascript">
			function submitForm() {
			  document.form.submit();
			}
			window.setTimeout("submitForm()", 60);
		</script>
	</cffunction>

	<cffunction name="getNamedList" access="remote" returntype="query" output="false">

		<cfset var query = "" />

		<cfquery name="queryNamed" datasource="tidtool">
			SELECT *
			FROM Named
			WHERE MonsterName <> ''
			ORDER BY MonsterName ASc
		</cfquery>
		<cfreturn queryNamed />
	</cffunction>

	<cffunction name="getCountNamedDouble" access="remote" returntype="query" output="false">

		<cfset var queryCountAllDoubleNamed = "" />

		<cfquery name="queryCountAllDoubleNamed" datasource="tidtool">
			SELECT *
			FROM NamedDouble_Person
		</cfquery>
		<cfreturn queryCountAllDoubleNamed />
	</cffunction>

</cfcomponent>